
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[spTaxi_GetAllTaxis]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spTaxi_GetAllTaxis]
GO

GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eric Liew
-- Create date: 6/2/2009
-- Description:	Get all Plate
-- =============================================
CREATE PROCEDURE [dbo].[spTaxi_GetAllTaxis]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;


	SELECT 
		TaxiId,
		Taxi.PlateId,
		Vehicle.VehicleId,
		Plate.PlateNumber,
		Vehicle.Rego as "VehicleRego"
	FROM Taxi
	INNER JOIN Plate
	ON Plate.PlateId = Taxi.PlateId
	INNER JOIN Vehicle
	ON Vehicle.VehicleId = Taxi.VehicleId
	
 

END
GO
